//var mp3Url="http://mp3.9ku.com";
var mp3Url="http://mp3.jiuku.com";
var picUrl="http://img.9ku.com";
var go1=true;//允许返回首页标记(首页true，其它页是false)
config.qk_type=1;
config.TreeArr=null;
var g_dtId=0;
var gretArr=[""];//返回按钮数组
var tempPlayArr=[];
var gdtempPlayArr=[];

/********播放器对象************/
var MediaPlayer={obj:null,mediaId:'',pro_w:216,youproId:'youpro',probtnId:'probtnId'};
var lrcflag=1,ptype=1;

function init(id,proId,youproId,probtnId){
	MediaPlayer.mediaId = id;
	if(proId && proId!=''){
		MediaPlayer.pro_w=$('#'+proId).width();
	}
	if(youproId && youproId!=''){
		MediaPlayer.youproId=youproId;
	}
	if(probtnId && probtnId!=''){
		MediaPlayer.probtnId=probtnId;
	}
	$("#ctrlBtnId,#ctrlBtnId2").click(function(){
		if(g_dtId==0 && (!tempPlayArr || tempPlayArr.length==0)){
			setToast3('<div style="color:#fff;background: rgba(0, 0, 0, 0.6);border-radius: 2px;padding: 2px;text-align: center;width:260px;margin: 0 auto;">当前无歌曲播放,去搜歌看看吧</div>');
			return;
		}
		var t_obj=$("#ctrlBtnId")[0];
		var t_obj2=$("#ctrlBtnId2")[0];
		var claName=t_obj.className;
		if(claName=='stop'){
			t_obj.className='play';
			t_obj2.className='play';
			getMedia().pause();
		}else{
			t_obj.className='stop';
			t_obj2.className='stop';
			try{getMedia().pause();}catch(e){}
			getMedia().play();
		}
	});
	$(".list").click(function(){
		if(!tempPlayArr || tempPlayArr.length==0){
			setToast3('<div style="color:#fff;background: rgba(0, 0, 0, 0.6);border-radius: 2px;padding: 2px;text-align: center;width:260px;margin: 0 auto;">当前无歌曲播放,去搜歌看看吧</div>');
			return;
		}
		showplsth();
	});
	$(".next").click(function(){
		if(g_dtId==0 && (!tempPlayArr || tempPlayArr.length==0)){
			setToast3('<div style="color:#fff;background: rgba(0, 0, 0, 0.6);border-radius: 2px;padding: 2px;text-align: center;width:260px;margin: 0 auto;">当前无歌曲播放,去搜歌看看吧</div>');
			return;
		}
		preSong(0);
	});
	$(".prev").click(function(){
		if(g_dtId==0 && (!tempPlayArr || tempPlayArr.length==0)){
			setToast3('<div style="color:#fff;background: rgba(0, 0, 0, 0.6);border-radius: 2px;padding: 2px;text-align: center;width:260px;margin: 0 auto;">当前无歌曲播放,去搜歌看看吧</div>');
			return;
		}
		preSong(1);
	});
	$("#shunId").click(function(){//0单曲,1顺序,2循环,3随机
		if(sjflag==2){
			$("#shunId")[0].className='shun1';
			sjflag=3;
			//setToast2("随机播放");
			setToast3('<div style="color:#fff;background: rgba(0, 0, 0, 0.6);border-radius: 2px;padding: 2px;text-align: center;width:80px;margin: 0 auto;">随机播放</div>');
		}else if(sjflag==3){
			$("#shunId")[0].className='shun4';
			sjflag=1;
			setToast3('<div style="color:#fff;background: rgba(0, 0, 0, 0.6);border-radius: 2px;padding: 2px;text-align: center;width:80px;margin: 0 auto;">顺序播放</div>');
		}else if(sjflag==1){
			$("#shunId")[0].className='shun3';
			setToast3('<div style="color:#fff;background: rgba(0, 0, 0, 0.6);border-radius: 2px;padding: 2px;text-align: center;width:80px;margin: 0 auto;">单曲循环</div>');
			sjflag=0;
		}else if(sjflag==0){
			$("#shunId")[0].className='shun2';
			setToast3('<div style="color:#fff;background: rgba(0, 0, 0, 0.6);border-radius: 2px;padding: 2px;text-align: center;width:80px;margin: 0 auto;">列表循环</div>');
			sjflag=2;
		}
	});
	try{window.scrollTo(0,0);}catch(e){}
	try{
		MediaPlayer.canPlayM4a = !!(document.createElement('audio').canPlayType("audio/mpeg"));
		MediaPlayer.canPlayAac = !!document.createElement("audio").canPlayType && document.createElement("audio").canPlayType('audio/mp4; codecs="mp4a.40.2"')=='probably';
	}catch(e){}
	loadFocuspic();
	loadtjData();
}

